import collections
import functools
class Solution(object):
    def minimumLines(self, points):
        n = len(points)
        @functools.cache
        def dfs(val):
            if val == 0:
                return 0
            if val & (val - 1) == 0:
                return 1
            for i in range(n):
                if (val >> i) & 1:
                    index = i
            val ^= (1 << index)
            d = collections.defaultdict(list)
            for j in range(n):
                if (val >> j) & 1:
                    a = points[index][0] - points[j][0]
                    b = points[j][1] - points[index][1]
                    c = points[index][1] * points[j][0] - points[index][0] * points[j][1]
                    if a == 0:
                        d[(0, b / b, c / b)].append(j)
                    else:
                        d[(a / a, b / a, c / a)].append(j)
            min_l = float('inf')
            for key in d:
                next_val = val
                for j in d[key]:
                    next_val ^= (1 << j)
                min_l = min(min_l, 1 + dfs(next_val))
            return min_l

        return dfs((1 << n) - 1)

data = Solution()
points = [[0,2],[-2,-2],[1,4]]
print(data.minimumLines(points))